﻿using System;
using System.Data;
using Business;
using UI_MasterPage;
using System.Collections.Generic;
using Entity;

namespace UI_Main
{
    public partial class PresentationDefault : System.Web.UI.Page
    {
        private ArticleBusiness _articleBusiness;

        protected void Page_Init(object sender, EventArgs e)
        {
            var masterPage = (PresentationMain)Master;
            if (masterPage != null) _articleBusiness = masterPage.ArticleBusiness;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                List<Article> articles = _articleBusiness.GetTopNew(10);
                ArticleListView.DataSource = articles;
                ArticleListView.DataBind();
            }
        }
    }
}